﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using SqlSugarTests.Comm;
using SqlSugarTests.Models;

namespace SqlSugarTests
{
    class Program
    {
        static void Main(string[] args)
        {
            var context = new SqlSugarConfig();

            var context2 = new SqlSugarConfig("Default", ConnStringType.Key);


            var data = context.Db.Queryable<Student>().ToList();

            var data2 = context2.Db.SqlQueryable<VW_StudentInfo>("Select * from VW_StudentInfo");

            //Student stu = db.Queryable<Student>().Where(x => x.Id == 3).First();

            //stu.Sex = 0;

            //db.Updateable(stu).ExecuteCommand();

            //StudentExtend extend = new StudentExtend()
            //{
            //    StuId = 1,
            //    Education = "本科",
            //    Email = "123456@126.com",
            //    Phone = "18303333333",
            //    Profession = "心理学",
            //};

            //db.Insertable(extend).ExecuteCommand();


            //context.Db.Deleteable<StudentExtend>(x=>x.Id==2).ExecuteCommand();

            Student stu = context.Students.GetById(3);
            //context.StudentExtends.AsDeleteable()




        }
    }
}
